package com.cainiao.stock.task;

import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

/**
 * @author Administrator
 */
@Component
public class MyTask {
    @Autowired
    private RestTemplate restTemplate;

    @XxlJob("stock-data-pick-stock-info")
    public void taskStock(){
        String url="http://localhost:8081/api/task/stock/";
        restTemplate.exchange(url, HttpMethod.GET,null,void.class);
    }

    @XxlJob("stock-data-pick-block-info")
    public void taskStockBlock(){
        String url="http://localhost:8081/api/task/InnerMarket";
        restTemplate.exchange(url, HttpMethod.GET,null,void.class);
    }

    @XxlJob("stock-data-pick-index-info")
    public void taskStockIndex(){
        String url="http://localhost:8081/api/task/block";
        restTemplate.exchange(url, HttpMethod.GET,null,void.class);
    }

}
